home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_crossblocks.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  92 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_CrossBlocks.cog
  4. #
  5. # Crushing Block script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message startup
  14.     message entered
  15.     message arrived
  16.     message timer
  17.     message blocked
  18.     
  19.     sound   trapset
  20.     sound   slidingstone
  21.     sound   stopsnd
  22.  
  23.     thing   player0
  24.     thing   crushblock      linkid=0    mask=0x405
  25.     thing   triggerblock    linkid=1    mask=0x405
  26.  
  27.     flex    moveSpeed=1.0
  28.     int     trigger         local
  29.     int     triggerloop     local
  30.     int     crushloop       local
  31.  
  32. end
  33.  
  34. # ========================================================================================
  35.  
  36. code
  37.  
  38. # ........................................................................................
  39. startup:
  40.     player0 = GetLocalPlayerThing();
  41.     return;
  42.     
  43.  
  44. # ........................................................................................
  45. entered:
  46.     if ((GetSenderRef() == triggerblock) && (trigger == 0))
  47.     {
  48.         trigger = 1;
  49.         SetTimer(3);
  50.         PlaySoundThing(trapset, triggerblock, 1, 3, 10, 0);
  51.     }
  52.     return;
  53.  
  54. # ........................................................................................
  55. timer:
  56.     MoveToFrame(triggerblock, 1, (moveSpeed * 5));
  57.     triggerloop = PlaySoundThing(slidingstone, triggerblock, 1, 3, 10, 1);
  58.     return;
  59.     
  60. # ........................................................................................
  61. arrived:
  62.     if (GetSenderRef() == triggerblock)
  63.     {
  64.         StopSound(triggerloop, 0);
  65.         PlaySoundThing(stopsnd, triggerblock, 1, 3, 10, 0);
  66.         MoveToFrame(crushblock, 1, moveSpeed);
  67.         crushloop = PlaySoundThing(slidingstone, crushblock, 1, 3, 10, 1);
  68.     }
  69.     
  70.     if (GetSenderRef() == crushblock)
  71.     {
  72.         StopSound(crushloop, 0);
  73.         PlaySoundThing(stopsnd, crushblock, 1, 3, 10, 0);
  74.     }        
  75.         
  76.     return;
  77.     
  78. # ........................................................................................
  79. blocked:
  80.     if (GetSenderRef() == crushblock)
  81.     {
  82.         //print("Damaging Indy");
  83.         DamageThing(player0, 1000, 0x1, crushblock);
  84.     }
  85.     return;
  86. # ........................................................................................
  87.     
  88.                         
  89.  
  90. end
  91.  
  92.